package com.jinzecloud.fiction.controller;

import java.util.Arrays;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.jinzecloud.fiction.bean.TbMyMassage;
import com.jinzecloud.fiction.service.TbMyMassageService;
import com.jinzecloud.fiction.utils.PageUtils;
import com.jinzecloud.fiction.utils.R;



/**
 * 我的消息
 *
 * @author ??
 * @email 1971240051@qq.com
 * @date 2023-10-19 19:38:04
 */
@RestController
@RequestMapping("fiction/tbmymassage")
public class TbMyMassageController {
    @Autowired
    private TbMyMassageService tbMyMassageService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("fiction:tbmymassage:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = tbMyMassageService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{agId}")
    //@RequiresPermissions("fiction:tbmymassage:info")
    public R info(@PathVariable("agId") Integer agId){
		TbMyMassage tbMyMassage = tbMyMassageService.getById(agId);

        return R.ok().put("tbMyMassage", tbMyMassage);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("fiction:tbmymassage:save")
    public R save(@RequestBody TbMyMassage tbMyMassage){
		tbMyMassageService.save(tbMyMassage);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //@RequiresPermissions("fiction:tbmymassage:update")
    public R update(@RequestBody TbMyMassage tbMyMassage){
		tbMyMassageService.updateById(tbMyMassage);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("fiction:tbmymassage:delete")
    public R delete(@RequestBody Integer[] agIds){
		tbMyMassageService.removeByIds(Arrays.asList(agIds));

        return R.ok();
    }

}
